package network;
import java.util.Vector;

import tools.Point;
import game.controlling.Controller;
public class NetworkController extends Controller {
	private Point mp;
	public Vector<String> keys, buttons;
	public Vector<String> cKeys, cButtons;
	public Vector<String> rKeys, rButtons;
	public NetworkController() {
		keys = new Vector<String>();
		buttons = new Vector<String>();
		cKeys = new Vector<String>();
		cButtons = new Vector<String>();
		rKeys = new Vector<String>();
		rButtons = new Vector<String>();
		mp = new Point();
	}
	public void addTouchedKey(String eventKey) {
		keys.addElement(eventKey);
		cKeys.addElement(eventKey);
	}
	public void addReleasedKey(String eventKey) {
		keys.remove(eventKey);
		rKeys.add(eventKey);
	}
	public void clear() {
		cKeys.clear();
		cButtons.clear();
		rKeys.clear();
		rButtons.clear();
	}
	public void setMouseX(float x) {
		mp.x = x;
	}
	public void setMouseY(float y) {
		mp.y = y;
	}
	@Override
	public Point getMp() {
		return mp;
	}
	@Override
	public boolean pressedGame(String c) {
		return keys.contains(c);
	}
	@Override
	public boolean touchedGame(String c) {
		return cKeys.contains(c);
	}
	@Override
	public boolean releasedGame(String c) {
		return rKeys.contains(c);
	}
	public void setMp(Point p) {
		mp = p;
	}
}
